package hashtable;

import java.util.Scanner;

/**
 * @ author : HyoJoo-W
 * @ createDate : 2021-06-04 14:47
 * @ Description :
 */
public class TestHashTable
{
    public static void main(String[] args)
    {
        HashTable hashTable = new HashTable(7);

        String key = "";
        Scanner scanner = new Scanner(System.in);
        while(true)
        {
            System.out.println("add: 添加员工");
            System.out.println("list: 员工列表");
            System.out.println("find: 查询员工");
            System.out.println("exit: 退出系统");
            key = scanner.next();
            switch (key)
            {
                case "add":
                    System.out.println("输入id: ");
                    int id = scanner.nextInt();
                    System.out.println("输入name: ");
                    String name = scanner.next();

                    Emp emp = new Emp(id,name);
                    hashTable.add(emp);
                    break;
                case "list":
                    hashTable.list();
                    break;
                case "find":
                    System.out.println("请输入查询员工id:");
                    int findId = scanner.nextInt();
                    hashTable.findEmpById(findId);
                    break;
                case "exit":
                    System.out.println("系统退出");
                    System.exit(0);
            }


        }
    }

}
